#include "GameMath.h"
#include "Rasenshuriken.h"
#include "../../data/GameInfo.h"

Rasenshuriken::Rasenshuriken()
{
    SDL_Texture *texture = GameInfo::Instance().texturePool[TexId::TEX_RASENSHURIKEN];
    int hNum = 2, wNum = 4;
    std::vector<int> idxList;
    for (int j = 0; j < 10; j++) {
        for (size_t i = 0; i < hNum * wNum; i++) {
            idxList.emplace_back(i);
        }
    }
    animation.SetFrameData(texture, hNum, wNum, idxList);
    animation.heightFrame = 256;
    animation.widthFrame = 256;
    animation.isLoop = false;
    animation.onFinished = [this] { isValid = false; };
    animation.SetInterval(0.1);
    animation.texture = texture;
    shape.type = ShapeType::RECT;
    damage = 1;
    speed = 4;
    shape.w = 216;
    shape.h = 216;
    consume = 50;
    isOnce = false;
    needRotate = false;
}